<template>
  <ul class="message-list">
    <li class="message-list-item" v-for="item in list">
      <p>{{ item.content }}</p> <button type="button" @click="addZanCount(item.mid)">点赞 {{ item.zanCount }}</button>
    </li>
  </ul>
</template>

<script>
export default {
  name: 'DEMOMessageList',

  data() {
    return {

    };
  },

  props: {
    list: Array,
  },
  mounted() {
    console.log(this.list);
  },

  methods: {
    addZanCount(mid) {
      this.$emit('clickzan', mid)
    }
  },
};
</script>

<style lang="less" scoped>
.message-list-item {
  border-bottom: 1px solid gray;
  margin-bottom: 20px;
  height: 50px;
  line-height: 50px;

  >p {
    float: left;
  }

  >button {
    float: right
  }
}
</style>